package dao;

import java.math.BigInteger;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PictureGroupDao {
	public static List getPictureGroup(){
		try {
			List pictures = (List) SqlClient.getSqlMap().queryForList("selectPictureGroup",new HashMap());
			return pictures;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	public static void addPictureGroup(Map m){
		try {
			SqlClient.getSqlMap().insert("insertPictureGroup",m);
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
	}
	
	public static Integer getMaxId(){
		Integer i = null;
		try {
			if(getPictureGroup().size() > 0){
				i = (Integer)SqlClient.getSqlMap().queryForObject("selectMaxIdOfGroup");
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
			return 0;
		}
		return i;
	}
}
